Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Tracking a Player's Location / Displaying it on Hud

  1. #1

    Default Tracking a Player's Location / Displaying it on Hud

    Is there an easy way to track the player who has been selected as the "rabbit"? I think I've seen this before, but I'm not sure if it exists. In freeze-tag it states the location of where the player is frozen, but I'd like it to be updated in real time as the rabbit moves around the map. Is this possible? Is there code that exists to do this already? If so, I don't have it

  2. #2
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,245

    Default

    It exists. There was a server-side radar that was showing all of the players to all, you could edit it so it shows only rabbit to everyone. I think James may know where it is, as it was meant to be a part of old 1.12 patch, and I think it was uploaded to TMT also. Look for something like Player radar or so.

  3. #3

    Default

    Got it. So something like this might work? It's part of the rabbit script:


    Code:
    level waittill spawn
        
        if (int(getcvar(radarOn)) == 1){
            thread radar
        }
    radar:

    Code:
    radar:
    	if(level.setupradar)
    		end
    
    	level.setupradar = 1
    
    
    
    	local.mapname = getcvar mapname
    
    	local.mapname = waitexec global/strings.scr::to_lower local.mapname
    
    	local.setup = waitthread setup_radar local.mapname
    
    	if(local.setup)
    		{
    		level.radar = 1
    		}
    		else 
    		{
    		println "*****************Radar data not valid for this map - turning Radar off******************"
    		end
    		}
    
    	exec global/Radar.srd
    
    	while(1)
    	{
    	for(local.i=1;local.i<=$player.size;local.i++)
    		{
    		if($player[local.i].listener != NIL)
    			{
    			local.result = $player[local.i].origin
    			local.pos[0] = ((level.max_y - local.result[1]) / level.ydevider)
    			local.pos[1] = ((level.max_x - local.result[0]) / level.xdevider)
    			if(local.mapname == obj/obj_team3)
    				{
    				  if($player[local.i] == level.rabbit){
    				    huddraw_rect $player[local.i].listener.hud local.pos[1] local.pos[0] 10 10
    				  }
    				}
    			else
    				{
    				  if($player[local.i] == level.rabbit){
    				    huddraw_rect $player[local.i].listener.hud local.pos[0] local.pos[1] 10 10
    				  }
    				}
    			}
    		
    	waitframe
    	}
    end
    Figured I'd attach the mod as well to this post.
    Attached Files Attached Files

  4. #4
    Administrator James's Avatar
    Join Date
    May 2010
    Location
    on the intraweb
    Posts
    3,071

    Default

    haha yeah I remember the radar mod :P
    I think the original was sorridstrokers or jv_maps.

  5. #5
    Administrator JoTo's Avatar
    Join Date
    May 2010
    Location
    www.scapp.net
    Posts
    1,952

    Default

    This reminds me of a suggestion I had in mind maybe its the same or similiar to own3mall's, a mini map with location of players (as you know it from cod games etc.) would be possible ?

  6. #6

    Default

    yes joto I think sorridstoker made this. search modtheater.com

    don't play cod but ppl always tell me of "original features" in cod, which are from quake ..

  7. #7
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,245

    Default

    Yes it is possible. You can even script it in a way that a red dot or marker appears when player fires a weapon.

  8. #8
    Administrator JoTo's Avatar
    Join Date
    May 2010
    Location
    www.scapp.net
    Posts
    1,952

    Default

    I know the mod from sorridstroker, its nice and works, but it uses the compass as the background, I meant instead of the compass a minimap as an representation of the actual map, that possible ?

  9. #9

    Default

    hello all,
    I have screenshots of each map and would like to make a pk3 file client-side going to replace the "compassface" with the image of the map, but only for those who have this file
    for example (im noob so it's sure wrong...just for explane better)
    on client-side pk3

    mapshud.scr

    main:

    local.status = 1
    switch(local.maphud)
    {
    case "dm/mohdm1":
    {
    local.maphud = "textures/map/southern.tga"
    }
    break
    case "dm/mohdm2":
    {
    local.maphud = "textures/map/destroyed.tga"
    }
    break
    case "dm/mohdm3":
    {
    local.maphud = "textures/map/blabla.tga"
    }
    break
    end

    on radar mod

    for(local.i=1;local.i<=$player.size;local.i++)
    {
    local.status = waitexec mapshud.scr
    if(local.status != 1)
    {
    local.number = 100
    huddraw_alpha local.number 1.0
    huddraw_align local.number left center
    huddraw_virtualsize local.number 1
    huddraw_shader local.number "textures/hud/compassface.tga"
    huddraw_rect local.number -25 50 160 160
    }
    else
    {
    local.number = 100
    huddraw_alpha local.number 1.0
    huddraw_align local.number left center
    huddraw_virtualsize local.number 1
    huddraw_shader local.number local.maphud
    huddraw_rect local.number -25 50 160 160
    }

    it's possible or are the ravings of an ignorant?? lol
    tnx very much

  10. #10
    Developer Sor's Avatar
    Join Date
    Aug 2010
    Location
    The Medieval City of Bruges
    Posts
    747

    Default

    Definately possible. But like you said it will be client-side only until the client-side patch enables auto-downloading.
    In that scenario you will know all clients will have the necessary files but unfortunately at this moment you cannot
    know which clients have the content.

    I'd display both but make sure compass element index < screenshot element index < player elements indexes,
    so the screenshot hud will be 'in front of' the compass hud.
    Morpheus Script (MoH) => You try to shoot yourself in the foot only to discover that MorpheusScript already shot your foot for you.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •